/********************************************************************************
 *      Copyright:  (C) 2025 iot25<lingyun@email.com>
 *                  All rights reserved.
 *
 *       Filename:  proc.h
 *    Description:  This file 
 *
 *        Version:  1.0.0(13/05/25)
 *         Author:  iot25 <lingyun@email.com>
 *      ChangeLog:  1, Release initial version on "13/05/25 16:59:12"
 *                 
 ********************************************************************************/
#ifndef _PROC_H_
#define _PROC_H_

#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <libgen.h>
#include <fcntl.h>

#include "proc.h"
#include "logger.h"

proc_signal_t   	g_signal = {0};
static int			timeset = 30;

/*信号处理 */
void proc_sig(int signum);

void proc_install_signal(int times);

/*后台运行*/
int proc_daemon(int daemon_flag, char *pidfile);

int proc_check_daemon(char *pidfile);

pid_t get_daemon_pid(char *pidfile);

int record_daemon_pid(char *pidfile);

int stop_deamon(char *pidfile);

#endif
